home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / clonecd / September 93.img / Archives / Fun, Tricks & Hacks / Hacks & Tricks - CARE / HotShift / GetMouse.c next >
C/C++ Source or Header  |  1991-09-01  |  701b  |  31 lines

  1. pascal void main(Point *thePt);
  2.  
  3.  
  4. pascal void main(Point *thePt)
  5. {
  6.     pascal void    (*addr)(Point *);
  7. //    Ptr        addr;
  8.     Ptr        globalP;
  9.     
  10.     asm {
  11.         MOVEM.L    A2-A5/D1-D7, -(A7)            /* Save the non-volitle registers         */
  12.     }
  13.         
  14.     addr = *(void**)(((Ptr)&main) - 8);        /* Get the address of destination trap     */
  15.     globalP = *(Ptr *)(((Ptr)&main) - 4);    /* Get the address of global storage     */
  16.                                             /* The structure is:
  17.                                                     long    OldTrapAddress;
  18.                                                     Ptr        globalDataSpace;        */
  19.  
  20.  
  21.     (*addr)(thePt);
  22.     thePt->h -= 32;
  23.     thePt->v -= 32;
  24. //    DebugStr("\PMade it!");
  25. //    asm {
  26. //            MOVEM.L        (A7)+, A2-A5/D1-D7    /* Restore the non-volitle registers    */
  27. //            MOVE.L        addr, A0
  28. //            UNLK        A6
  29. //            JMP            (A0)        
  30. //    };
  31. }